Add RTD Denver transit support - #1
Conversation
There was a problem hiding this comment.
Pull request overview
Adds RTD Denver as a supported transit agency (static GTFS + GTFS-realtime) and updates the feed clients to correctly resolve relative redirects while maintaining HTTPS-only behavior.
Changes:
- Add RTD Denver to
GtfsAgencywith static and realtime feed endpoints. - Update GTFS static and GTFS-RT clients to resolve relative redirects (via
URI.resolve). - Update README documentation to include RTD Denver in the supported agency list.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tool/src/main/kotlin/com/thelightphone/transit/gtfs/GtfsRealtime.kt | Resolves redirect targets (including relative) for GTFS-RT fetches while enforcing HTTPS-only. |
| tool/src/main/kotlin/com/thelightphone/transit/gtfs/GtfsIngestor.kt | Resolves redirect targets (including relative) for GTFS zip HEAD/GET while enforcing HTTPS-only. |
| tool/src/main/kotlin/com/thelightphone/transit/gtfs/GtfsAgency.kt | Adds RTD Denver static + realtime endpoint URLs to the agency enum. |
| tool/README.md | Documents RTD Denver as a supported agency. |
| README.md | Documents RTD Denver as a supported agency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /** Resolves absolute and relative redirects while never following a redirect back to plain HTTP. */ | ||
| private fun secureRealtimeRedirectUrl(currentUrl: String, location: String): String { | ||
| val resolved = URI(currentUrl).resolve(location).toString() | ||
| return if (resolved.startsWith("http://")) { | ||
| "https://" + resolved.removePrefix("http://") | ||
| } else { | ||
| resolved | ||
| } | ||
| } |
| /** Resolves absolute and relative redirects while never following a redirect back to plain HTTP. */ | ||
| private fun secureRedirectUrl(currentUrl: String, location: String): String { | ||
| val resolved = URI(currentUrl).resolve(location).toString() | ||
| return if (resolved.startsWith("http://")) { | ||
| "https://" + resolved.removePrefix("http://") | ||
| } else { | ||
| resolved | ||
| } | ||
| } |
There was a problem hiding this comment.
Hey Jose! Does this change resolve the HTTP:// vs HTTPS:// issues for other agencies aswell? before I merge the change, I'd like to confirm that RIPTA will still work with these changes (HTTP:// Realtime feed)
There was a problem hiding this comment.
It did on my end, but you can compile and test on your end to make sure that this is the case for your device as well. Lmk and if it doesn’t work I’ll find a workaround.
There was a problem hiding this comment.
It worked but because the netconfig module bypass isn't removed I think RIPTA is still using that. I have a discussion open on it in the light SDK. just tested denver. Loaded up On here. Left a parentheses in the homescreen that stopped the compile... my bad... but It looks like Denver is working but was a little wonky switching agencies earlier. Thoughts on bustang? it looks like they have a separate feed for it. I can add it as a separate feed. the one structural difference I noticed is direction is in the routes, I'd just need add a check to see if routes contain directions, if not schedules should jump to the stops screen for agencies like Bustang... On another note I need to add an issue for a bug with stop tracking for buses, if it falls back on raw geocodes it may jump ahead if a stop is technically closer. happened to me the other day when I was riding in to providence, passed the stop going into the city and finished the trip while the bus needed to hit a few more stops... working on it.
There was a problem hiding this comment.
@CJFData Bustang is a good idea, but having to use a different GTFS is problematic. I'll see if I can make the Denver selector pull from both feeds at the same time.
Summary
Validation
./gradlew :tool:assembleDebugcould not complete because GitHub Maven credentials are unavailable forcom.thelightphone.lp3keyboard:ui:0.0.16.,workdir